package com.sz.common.core.service;

import org.apache.shiro.session.Session;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Function: MockPrincipalManager <br>
 * Author: Charles <br>
 * Date: 2017-01-22 12:58:00
 */

@Service
public class MockPrincipalManager implements PrincipalManager {

    @Override
    public Principal getPrincipal() {
        Principal principal = new MockPrincipal(1, 1, "root");
        principal.setIpAddr("127.0.0.1");
        return principal;
    }

    @Override
    public Principal getPrincipal(Session session) {
        return null;
    }

    @Override
    public Principal createAnonymousPrincipal() {
        return null;
    }

    @Override
    public Principal setupPrincipal(int appDomain, int accountId, String accountName, Map<String, Object> props) {
        return null;
    }

    @Override
    public boolean isAnonymousSupported() {
        return false;
    }

    @Override
    public void principalUpdated(Principal principal) {

    }
}
